﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucAddCategories.ascx.cs"
    Inherits="Admin_UserControl_ucAddCategories" %>

<h1>List Categories</h1>
<br />
<div>
<asp:HyperLink ID="hyp" runat="server" NavigateUrl="~/Admin/ListItems.aspx" 
        Font-Size="Medium">Back</asp:HyperLink>
</div>
<br />
<table class="style2">
    <tr>
        <td valign="top">
            <asp:Panel ID="Panel1" runat="server" >
                <table style="width: 100%">
                    <tr>
                        <th>
                            Category Name :
                        </th>
                        <td>
                            <asp:TextBox ID="txtCateName" runat="server" CssClass="inp-form"></asp:TextBox>
                            &nbsp;<asp:RequiredFieldValidator ID="reqCatename" runat="server" ControlToValidate="txtCateName"
                                Text="*" Font-Bold="True" ForeColor="Red"></asp:RequiredFieldValidator><asp:Label
                                    ID="lb_message" runat="server" ForeColor="Red"></asp:Label></td>
                                    
                    </tr>
                    <tr>
                        <th>
                            Category Description :
                        </th>
                        <td>
                            <asp:TextBox ID="txtCateDes" runat="server" TextMode="MultiLine" CssClass="form-textarea"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="rqDescription" runat="server" ControlToValidate="txtCateDes"
                                Text="*" Font-Bold="True"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            Image
                        </th>
                        <td>
                            <asp:FileUpload ID="upload" runat="server" CssClass="file_1" />
                            <asp:RequiredFieldValidator ID="rqupload" runat="server" 
                                ErrorMessage="*" ControlToValidate="upload"></asp:RequiredFieldValidator>
                            <asp:Label ID="lbmesage" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="btAdd" runat="server" Text="Save" OnClick="btAdd_Click" />
                        </td>
                    </tr>
                </table>
            </asp:Panel>
        </td>
        <td >
            <asp:GridView ID="grdCate" runat="server" CellPadding="3" AutoGenerateColumns="False"
                AllowPaging="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                BorderWidth="1px" OnPageIndexChanging="grdCate_PageIndexChanging1"
                ShowFooter="True" Width="550px" PageSize="4">
                <RowStyle ForeColor="#000066"/>
                <FooterStyle BackColor="White" ForeColor="#000066" />
                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" Height="35px" />
                
                <Columns>
                    <asp:TemplateField HeaderText="STT">
                        <ControlStyle Height="22px" />
                        <ItemStyle HorizontalAlign="Center" Width="30px" />
                        <ItemTemplate>
                            <asp:Label ID="STT" runat="server" Text="<%# ((grdCate.PageIndex * grdCate.PageSize) + grdCate.Rows.Count + 1)%>" /></ItemTemplate>
                    </asp:TemplateField>
                    <%--   <asp:BoundField DataField="CateName" HeaderText="CategoryName" SortExpression="CateName">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:BoundField>--%>
                    <asp:HyperLinkField DataTextField="CateName" DataNavigateUrlFormatString="~/Admin/ListCategories.aspx?id={0}"
                        HeaderText="Category Name" SortExpression="CateName" DataNavigateUrlFields="CateID">
                        <ItemStyle Width="150px" />
                    </asp:HyperLinkField>
                    <asp:BoundField DataField="CateDescription" HeaderText="Category Description" SortExpression="CateDescription" />
                    <asp:ImageField HeaderText="Images" DataImageUrlField="ImageURL" DataImageUrlFormatString="~/Admin/images/Items/{0}">
                        <ControlStyle Height="80px" Width="100px" />
                    </asp:ImageField>
                </Columns>
            </asp:GridView>
        </td>
    </tr>
</table>

